package com.brrbaii.utils;

import com.brrbaii.common.BaseResponse;
import com.brrbaii.common.ErrorCode;

/**
 * 返回结构工具类
 */
public class ResultUtils {
    public static <T>BaseResponse<T> success(T data){
        return new BaseResponse(0,data,"success","");
    }

    public static <T>BaseResponse<T> success(){
        return new BaseResponse(0,null,"success","");
    }


    public static BaseResponse error(ErrorCode errorCode){
        return new BaseResponse(errorCode);
    }

    public static BaseResponse error(ErrorCode errorCode,String description){
        return new BaseResponse(errorCode,description);
    }

    public static BaseResponse error(int code, String message,String description){
        return new BaseResponse(code,message,description);
    }


}
